package util.io;

import javax.swing.JFileChooser;

/**
 * Displays a dialog which allows the user to select a file.
 * 
 * @author team07
 */
public class FileChooser {

	/**
	 * Creates a dialog window which asks for the user to chose a NameFile to
	 * read names, and other information from.
	 * 
	 * @return String the absolute path to file chosen.
	 */
	public static String getFile(String title) {
		JFileChooser fc = new JFileChooser(System.getProperty("user.dir"));
		fc.setDialogTitle(title);
		fc.showOpenDialog(null);
		return fc.getSelectedFile().getAbsolutePath();
	}
}
